<?php
    
        include('confdb.php');

        $num = "SELECT * FROM vistuplenie WHERE vistuplenie_nomer=0 AND vistuplenie_pokaz=0 AND vistuplenie_activno=2 AND vistuplenie_zaversheno=2";

        $numer = mysqli_query($conn, $num);
        $otvet['kort'] =array();
        while ($row= mysqli_fetch_array($numer)) {
            $kort = array();
            $kort['kol'] = $row['vistuplenie_kolsud'];
            $kort['sys'] = $row['vistuplenie_sys'];
            $kort['kort'] = $row['vistuplenie_kort'];
            $kort['ids'] = $row['idvistuplenie'];
            $ids = $row['idvistuplenie'];
            $sud = "SELECT * FROM sudgotov WHERE vistuplenie_idvistuplenie = '$ids'";
            $result = mysqli_query($conn, $sud);
            $kort['kolconn'] = mysqli_num_rows($result);
            array_push($otvet['kort'], $kort);
        }

        $otvet['success'] = 1;


        echo json_encode($otvet);

?>